convert text file to json php

28

<?php
  header('Content-type: application/json');
  echo json_encode( explode("\r\n",file_get_contents('data.txt')) );
?>

Comments

Submit
0 Comments